<?php
$txt1=trim($_POST['text1']);
$txt2=trim($_POST['text2']);
$txt3=trim($_POST['text3']);
$button=$_POST['button'];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title>迅雷和FlashGet,QQ旋风地址 地址转换工具</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="迅雷,FlashGet,地址转换," name="keywords">
<style>
	a {
		text-decoration:none;
	}
	a:link {
		color:red;
	}
	a:visited {
		color:black;
	}
	a:hover {
		text-decoration:underline;
	}
</style>
</head>
<body style="text-align:center">
<h3><a href="<?php echo $_SERVER['php_self']?>">迅雷FlashGet,QQ旋风在线转换工具</a></h3>

 <form name="form1" method="post" action="">
  
  <h3> 迅雷转换<span style="font-size:0.8em ;margin-left:20px"><a href ="http://www.gougou.com/" target="_blank">迅雷资源搜索</a></span></h3>
  <P>转换地址：
   <input name="text1" value="<?php echo $txt1;?>" type="text" style="width:516px;" />
  </P>
  <P>转换后的：
   <input type="text" value="<?php
    if($button=="普通地址->迅雷地址") echo "thunder://".base64_encode("AA".$txt1."ZZ");
     if($button=="迅雷地址->普通地址") echo substr(base64_decode(str_ireplace("thunder://","",$txt1)),2,-2);
	if($button=="迅雷地址->QQ旋风地址") { 
		$original = substr(base64_decode(str_ireplace("thunder://","",$txt1)),2,-2);
		echo "qqdl://".base64_encode($original);
	}
	 
   ?>" style="width:516px;" />
   
   
   </P>
  <P>
   <input type="submit" name="button" value="普通地址->迅雷地址" />
   <input type="submit" name="button" value="迅雷地址->普通地址" />
   <input type="submit" name="button" value="迅雷地址->QQ旋风地址" />
  </P>
  
  <h3>QQ旋风转换</h3>
  <P>QQ旋风地址：
   <input name="text3"   value="<?php echo $txt3;?>" type="text" style="width:516px;" />
  </P>
  <P>转换后 地址：
   <input type="text" value="<?php
    if($button=="普通地址->QQ旋风") echo "qqdl://".base64_encode($txt3);
     if($button=="QQ旋风->普通地址") echo base64_decode(str_ireplace("qqdl://","",$txt3));
   ?>" style="width:516px;" /></P>
  <P>
   <input type="submit" value="普通地址->QQ旋风" name="button" />
   <input type="submit" value="QQ旋风->普通地址" name="button" />
  </P>
  <h3>FlashGet转换</h3>
  <P>FlashGet地址：
   <input name="text2"   value="<?php echo $txt2;?>" type="text" style="width:516px;" />
  </P>
  <P>转换后 地址：
   <input type="text" value="<?php
    if($button=="普通地址->FlashGet地址") echo "flashget://".base64_encode($txt2);
    if($button=="FlashGet地址->普通地址") echo str_ireplace("[FLASHGET]","",base64_decode(str_ireplace("flashget://","",$txt2)));
	 
	if($button=="FlashGet地址->迅雷地址") { 
		$original = str_ireplace("[FLASHGET]","",base64_decode(str_ireplace("flashget://","",$txt2)));
		echo "thunder://".base64_encode("AA".$txt1."ZZ");
	}  
	if($button=="迅雷地址->QQ旋风地址") { 
		$original = str_ireplace("[FLASHGET]","",base64_decode(str_ireplace("flashget://","",$txt2)));
		echo "qqdl://".base64_encode($original);
	} 
   ?>" style="width:516px;" /></P>
  <P>
   <input type="submit" value="普通地址->FlashGet地址" name="button" />
   <input type="submit" value="FlashGet地址->普通地址" name="button" />
   <input type="submit" value="FlashGet地址->迅雷地址" name="button" />
   <input type="submit" value="FlashGet地址->QQ旋风地址" name="button" />

  </P>
 </form>
</body>
</html>  